Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Creating Sequence Grabber Panel Components

This section discusses how to create a sequence grabber panel component. You should read this section if you are creating a panel component.

Applications do not call panel components directly. Rather, they invoke a sequence grabber's settings dialog box by calling the SGSettingsDialog function. In response, the sequence grabber presents the settings dialog box to the user. When the user selects a specific settings panel, the sequence grabber invokes the appropriate panel component.

Panel components provide a number of functions that allow sequence grabbers to manage their relationships with panel components. See "Managing Your Panel Component," for complete descriptions of these functions.

Panel components are not responsible for saving their settings information. Sequence grabbers manage this information on behalf of panel components, and a sequence grabber may combine configuration information from several panel components in order to build up the complete configuration for an elaborate digitizing environment. Panel components provide functions that allow sequence grabbers to obtain this configuration information. See "Managing Your Panel's Settings," for more information about these functions.

Sequence grabbers store this configuration data in user data items. The Movie Toolbox provides a number of functions that allow you to create and manage user data items. If you are not familiar with these functions, see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for more information.

Apple has defined a component type value for sequence grabber panel components. You can use the following constant to specify this component type.

#define     SeqGrabPanelType 'sgpn'         /* panel component type */

Sequence grabber panel components use their component subtype and manufacturer values to indicate the type of configuration services they provide. The subtype value indicates the media type supported by the panel component. This value should correspond to the component subtype value of channel components that may be configured by the panel component. For example, a panel component that manages video settings would have a subtype of 'vide' (this value is defined by the Movie Toolbox's VideoMediaType constant).

The manufacturer field contains a unique identifier for each panel component. The value should indicate something about the specific services provided by the component. For example, Apple has defined the following manufacturer values:

#define     SeqGrabCompressionPanelType             'sour'      /* input source
                                                                    selection */
#define     SeqGrabSourcePanelType                  'cmpr'      /* compression
                                                                    settings */

In general, Apple has reserved all lowercase values of component subtypes and manufacturer codes.

Apple has defined a functional interface for sequence grabber panel components. For information about the functions that your component must support, see "Sequence Grabber Panel Components Reference," . You may use the following constants to refer to the request codes for each of the functions that your component must support:

enum {
    /* sequence grabber panel request codes */

    kSGCPanelGetDitlSelect                  = 0x200,    /* SGPanelGetDITL */
    kSGCPanelCanRunSelect                   = 0x202,    /* SGPanelCanRun */
    kSGCPanelInstallSelect                  = 0x203,    /* SGPanelInstall */
    kSGCPanelEventSelect                    = 0x204,    /* SGPanelEvent */
    kSGCPanelItemSelect                     = 0x205,    /* SGPanelItem */
    kSGCPanelRemoveSelect                   = 0x206,    /* SGPanelRemove */
    kSGCPanelSetGrabberSelect               = 0x207,    /* SGPanelSetGrabber */
    kSGCPanelSetResFileSelect               = 0x208,    /* SGPanelSetResFile */
    kSGCPanelGetSettingsSelect              = 0x209,    /* SGPanelGetSettings */
    kSGCPanelSetSettingsSelect              = 0x20A,    /* SGPanelSetSettings */
    kSGCPanelValidateInputSelect            = 0x20B     /* SGPanelValidateInput */
};

Before reading the rest of this chapter, you should know how to create components. See the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for a complete discussion of components, how to use them, and how to create them.

The next section contains sample code for the creation of a sequence grabber panel component that acts as a settings dialog box for PICT images. To create a sequence grabber panel component, you set up the global variables and implement the required Component Manager request codes and the functions that are private to your particular component. Then you manage the dialog box and work with the settings in the dialog box.

Implementing the Required Component Functions

Managing the Dialog Box

Managing Your Panel's Settings


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next